<template>
	<div>
		<el-breadcrumb separator="/">
			<el-breadcrumb-item :to="item.path" v-for="(item,index) in list" :key="index">
				{{item.meta.title}}
			</el-breadcrumb-item>
			<!-- <el-breadcrumb-item><a href="/">活动管理</a></el-breadcrumb-item>
			<el-breadcrumb-item>活动列表</el-breadcrumb-item>
			<el-breadcrumb-item>活动详情</el-breadcrumb-item> -->
		</el-breadcrumb>
	</div>
</template>

<script>
export default {
	name: 'Breadcrumb',
	data() {
		return {
			list:[]
		};
	},
	components: {},
	created() {
		this.list = this.$route.matched
	},
	watch:{//监听
		$route(to,from){
			// console.log(to) // to $route对象
			this.list = to.matched
		}
	}
};
</script>
<style lang="scss" scoped>
	.el-breadcrumb{
		padding: 25px 10px;
	}
</style>
